import request from "@/services/request.ts";
export const getOrderList = async ()=>{
    return request.get('/order')
}
export const getOrderDetail = async (id:number)=>{
    return request.get(`/order/${id}`)
}
export const orderCreate = async (data:object)=>{
    return request.post('/order',data)
}
export const orderUpdate = async (id:number,data:object)=>{
    return request.put(`/order/${id}`,data)
}
export const orderDelete = async (id:number)=>{
    return request.del(`/order/${id}`)
}

/*
* 订单状态
* */
export const getOrderStatus = async ()=>{
    return request.get('/order/status')
}
export const orderStatusCreate = async (data:object)=>{
    return request.post('/order/status',data)
}
export const orderStatusUpdate = async (id:number,data:object)=>{
    return request.put(`/order/status/${id}`,data)
}
export const orderStatusDelete = async (id:number)=>{
    return request.del(`/order/status/${id}`)
}

//订单交付方式
export const getOrderDelivery = async ()=>{
    return request.get('/order/delivery')
}
export const orderDeliveryCreate = async (data:object)=>{
    return request.post('/order/delivery',data)
}
export const orderDeliveryUpdate = async (id:number,data:object)=>{
    return request.put(`/order/delivery/${id}`,data)
}
export const orderDeliveryDelete = async (id:number)=>{
    return request.del(`/order/delivery/${id}`)
}